#!/bin/bash
# description:  Rsync war file
# version:	1.0
# author:	zhangyanbin
# contact:	yanbin_zhang@foxitsoftware.com
#
. functions.sh

BRANCH=$1
RSH_OPTS="ssh -p 333 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i ${ID_RSA_PATH}"
RSYNC_OPTS="-av --progress" # TODO: add --info progress with a newer version of RSYNC

if [ ! -d /tmp/phantomonline ]; then
mkdir -p /tmp/phantomonline
fi


echo "--> Begin to download phantom-online file"
SOFILES_SRC=smx@${DL_SERVER}:/opt/www/${DL_SERVER}/phantom-online/latest/${BRANCH}/
rsync ${RSYNC_OPTS} --exclude "convert" -e "${RSH_OPTS}" ${SOFILES_SRC} /tmp/phantomonline/


